package org.black.phoneUtility.app.activity;

import org.black.phoneUtility.R;
import org.black.phoneUtility.app.fragment.BackupFileExploreFragment;

import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;

public class BackupFileExploreActivity extends Activity {
	public static final String ARGUMENTS_FILE_PATH = "arguments_file_path";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		getActionBar().setDisplayHomeAsUpEnabled(true);
		String filePath = getIntent().getExtras().getString(
				ARGUMENTS_FILE_PATH, null);
		setContentView(R.layout.phone_utility_backup_file_explorer_main);
		FragmentManager fragmentManager = getFragmentManager();
		Fragment fragment = new BackupFileExploreFragment();

		Intent intent = getIntent();
		Bundle bundle = intent.getExtras();

		bundle.putString(BackupFileExploreFragment.ARGUMENTS_FILE_PATH,
				filePath);
		fragment.setArguments(bundle);

		fragmentManager
				.beginTransaction()
				.replace(
						R.id.phone_utility_backup_file_explorer_main_content_frame,
						fragment, BackupFileExploreFragment.TAG).commit();
	}

	@Override
	public void onBackPressed() {
		this.finish();
		this.overridePendingTransition(R.animator.left_slide_enter,
				R.animator.left_slide_exit);
	}
}
